﻿////////////////////////////////////////////////////////////////////////
//Autor: Gabriel Tame Borao  - gabrieltame@yahoo.es 
//Fecha: 2010/09/15 01:26
//Solucion: GTameReport.sln
//Proyecto: GTameReport
//Fichero: DataSetType.cs
//
//	Copyright (C) 2010  Gabriel Tame Borao (GTB)
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////
namespace GTameReport
{
    using Rdl;
    using System;
    using System.Collections;

    public class DataSetType
    {
        private DataSetTypeAccentSensitivity _AccentSensitivity;
        private DataSetTypeCaseSensitivity _CaseSensitivity;
        private string _Collation;
        private GTameReport.FieldsType _Fields;
        private GTameReport.FiltersType _Filters;
        private DataSetTypeKanatypeSensitivity _KanatypeSensitivity;
        private GTameReport.QueryType _Query;
        private DataSetTypeWidthSensitivity _WidthSensitivity;
        private string nameField;

        public Rdl.DataSetType Write()
        {
            Rdl.DataSetType type = new Rdl.DataSetType();
            ArrayList list = new ArrayList();
            type.Name = this.nameField;
            list.Add(this._AccentSensitivity);
            list.Add(this._CaseSensitivity);
            if (this._Collation != null)
            {
                list.Add(this._Collation);
            }
            if (this._Fields != null)
            {
                list.Add(this._Fields.Write());
            }
            if (this._Filters != null)
            {
                list.Add(this._Filters.Write());
            }
            list.Add(this._KanatypeSensitivity);
            if (this._Query != null)
            {
                list.Add(this._Query.Write());
            }
            list.Add(this._WidthSensitivity);
            type.Items = list.ToArray();
            list = null;
            return type;
        }

        public DataSetTypeAccentSensitivity AccentSensitivity
        {
            get
            {
                return this._AccentSensitivity;
            }
            set
            {
                this._AccentSensitivity = value;
            }
        }

        public DataSetTypeCaseSensitivity CaseSensitivity
        {
            get
            {
                return this._CaseSensitivity;
            }
            set
            {
                this._CaseSensitivity = value;
            }
        }

        public string Collation
        {
            get
            {
                return this._Collation;
            }
            set
            {
                this._Collation = value;
            }
        }

        public GTameReport.FieldsType Fields
        {
            get
            {
                if (this._Fields == null)
                {
                    this._Fields = new GTameReport.FieldsType();
                }
                return this._Fields;
            }
            set
            {
                this._Fields = value;
            }
        }

        public GTameReport.FiltersType Filters
        {
            get
            {
                if (this._Filters == null)
                {
                    this._Filters = new GTameReport.FiltersType();
                }
                return this._Filters;
            }
            set
            {
                this._Filters = value;
            }
        }

        public DataSetTypeKanatypeSensitivity KanatypeSensitivity
        {
            get
            {
                return this._KanatypeSensitivity;
            }
            set
            {
                this._KanatypeSensitivity = value;
            }
        }

        public string Name
        {
            get
            {
                return this.nameField;
            }
            set
            {
                this.nameField = value;
            }
        }

        public GTameReport.QueryType Query
        {
            get
            {
                if (this._Query == null)
                {
                    this._Query = new GTameReport.QueryType();
                }
                return this._Query;
            }
            set
            {
                this._Query = value;
            }
        }

        public DataSetTypeWidthSensitivity WidthSensitivity
        {
            get
            {
                return this._WidthSensitivity;
            }
            set
            {
                this._WidthSensitivity = value;
            }
        }
    }
}

